package com.fxd.jdbctemplate;

import com.fxd.dao.IAccountDao;
import com.fxd.domain.account;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import javax.xml.bind.SchemaOutputResolver;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/**
 * @auther fuxudong
 * @date 2021/1/28 - 11:31
 * jdbcTemplate的crud操作
 */
public class jdbctemplatedao {

    public static void main(String[] args) {

        //1，获取容器
        ClassPathXmlApplicationContext ca = new ClassPathXmlApplicationContext("bean.xml");
        IAccountDao accountDao = ca.getBean("accountDao", IAccountDao.class);

        account accountById = accountDao.findAccountById(1);
        System.out.println(accountById);


    }
}


